MAINT: Reword property docstrings to noun phrases (D421)#2097
Merged
romanlutz merged 4 commits intoJun 29, 2026
Conversation
Reword 118 @Property docstrings across 80 files from verb-style (`Return the X`, `Get the X`) to Google-style noun phrases (`The X`) to satisfy Ruff's D421 (property-docstring-starts-with-verb) rule. Docstring-only change with no behavior change; ruff check, ruff format --check, and the full unit test suite all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jsong468
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
PyRIT's Ruff configuration enables the pydocstyle
Drules under the Google convention withpreview = true, which includesD421(property-docstring-starts-with-verb). The Google style guide recommends that an@propertydocstring read as a noun phrase describing the attribute (e.g."""The Bigtable path.""") rather than a function-style verb phrase (e.g."""Returns the Bigtable path."""). 118 legacy property docstrings across 80 files still started with a verb ("Return", "Returns", "Get"), so the rule was effectively unenforced against real violations.This change rewords those 118 property docstrings to noun phrases. It is documentation-only:
D421was already selected inpyproject.toml; these were pre-existing stragglers. (The separateDOC501per-file ignore forpyrit/backend/**is an unrelated rule.)Note:
D421has no autofix, so the rewording was applied with a small file-plus-row-targeted script driven by Ruff's JSON output.Tests and Documentation
Documentation-only change (property docstrings). Verified locally:
uv run ruff checkpasses (0 violations; previously 118 D421).uv run ruff format --checkclean (1313 files).